// 向量知识库状态枚举
export enum VectorStatus {
  ENABLED = 'enabled',
  DISABLED = 'disabled',
}

// 向量知识库类型枚举
export enum VectorType {
  TEXT = 'text',
  IMAGE = 'image',
  MIXED = 'mixed',
}

// 向量索引类型枚举
export enum VectorIndexType {
  FLAT = 'flat',
  HNSW = 'hnsw',
  IVF = 'ivf',
}

// 向量知识库接口
export interface Vector {
  id: string;
  name: string;
  description: string;
  baseType: 'text' | 'image' | 'mixed';
  status: VectorStatus;
  vectorModel: string;
  dimension: number;
  fileFormat: string;
  fileFormatArray: string[];
  splitStrategy: number;
  maxParagraphSize: number;
  maxOverlapSize: number;
  tags: string[];
  createTime: string;
  updateTime: string;
  itemCount: number;
}

// 向量知识库表单值接口
export interface VectorFormValues {
  id: string;
  name: string;
  description?: string;
  baseType: 'text' | 'image' | 'mixed';
  status: VectorStatus;
  vectorModel: string;
  dimension: number;
  fileFormat: string;
  fileFormatArray: string[];
  splitStrategy: number;
  maxParagraphSize: number;
  maxOverlapSize: number;
  indexType?: string;
  indexParams?: string;
}

export interface Knowledge {
  id: string;
  name: string;
  creatorId: string;
  collectionIdentifier: string;
  description: string;
  businessType: number;
  metaStorageType: number;
  vectorModel: string;
  itemCount: number;
  createTime: string;
  updateTime: string;
  baseId: string;
}

export interface KnowledgeFormValues {
  id?: string;
  name: string;
  creatorId?: string;
  collectionIdentifier?: string;
  description?: string;
  businessType?: number;
  metaStorageType: number;
  vectorModel: string;
  itemCount: number;
  baseId: string;
}


export interface KnowledgeItem {
  id: string;
  name: string;
  title?: string;
  summary?: string;
  content?: string;
  answerContent?: string;
  isEmbedded?: boolean;
  creatorId?: string | number;
  createTime: string;
  updateTime?: string;

  // 保留一些可能仍在使用的旧字段
  description?: string;
  fileFormat?: string;
  baseType?: string;
  vectorModel?: string;
  dimension?: number;
  splitStrategy?: number;
  maxParagraphSize?: number;
  maxOverlapSize?: number;
  sliceCount?: number;
  collectionId?: string;
  baseId?: string;
  status?: 'active' | 'inactive';
}

export interface KnowledgeItemFormValues {
  id: string;
  name: string;
  description: string;
  fileFormat: string;
  baseType: string;
  vectorModel: string;
  dimension: number;
  splitStrategy: number;
  maxParagraphSize: number;
  maxOverlapSize: number;
  createTime: string;
  updateTime: string;
  sliceCount: number;
  collectionId: string;
  baseId: string;
  status: 'active' | 'inactive';
}

// 分页响应接口
export interface PaginatedResponse<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
}

// API响应接口
export interface ApiResponse<T> {
  code: number;
  msg: string;
  status: boolean;
  data: T;
  fail: boolean;
}

// 知识条目查询参数接口
export interface KnowledgeItemQueryParams {
  collectionId: string;
  keyword?: string;
  isEmbedded?: number;
  pageNo?: number;
  pageSize?: number;
}